<?php
namespace app\index\model;

use think\Db;

class OldproductmanageModel
{
    /**
     * 图片/编辑 确定取消数据
     * @author LSH
     * @return array
     */
    public static function dbUpdateAffirmCancelAudit($param)
    {
        $table = $param['type'] == 'img'?'manage_img_audit':'manage_edit_audit';
        
        if($param['status'] == 'cancel'){
            $data['cancel'] = 1;
        }else{
            $data['assign_time'] = date('Y-m-d H:i:s',time());
            $data['manufacture_status'] = 2;
        }

        return Db::table($table)->where(['id'=>$param['id'],'sku'=>$param['sku'],'assign_id'=>0])->update($data);
    }

    /**
     * 老图片/编辑 分派数据
     * @author LSH
     * @return array
     */
    public static function  dbUpdateAssignInfo($param,$datas)
    {
        $table = $param['type'] == 'img'?'manage_img_audit':'manage_edit_audit';
        $data['operator'] = $param['operator'];
        $data['manufacture_status'] = 1;
        Db::table($table)->where(['id'=>$param['id']])->update($data);
        return true;
    }
}
